#pragma once

#include "Game.h"
#include "keyboard.h"
#include <windows.h>
#include "dxManager.h"
#include <d3d9.h>
#include <d3dx9tex.h>
#include <dinput.h>

class Game;
enum ent_type;

class Entity
{
protected:
	float x;
	float y;
	float z;
	float scale;
	float moveRate;
	ID3DXMesh *entMesh;
	D3DMATERIAL9 entMtrl;
	IDirect3DSurface9* texture;
	Game *parent;
	
public:
	Entity();
	Entity(Game *prnt);
	bool moveX(float amount);
	bool moveY(float amount);
	bool moveZ(float amount);
	void setX(float tempX) {x = tempX;}
	void setY(float tempY) {y = tempY;}
	void setZ(float tempZ) {z = tempZ;}
	void setMove(float move) {moveRate = move;}
	void setScale(float tempScale) {scale = tempScale;}
	void setTexture(dxManager* dx);
	int draw();
	Entity(ID3DXMesh *mesh, D3DMATERIAL9 mtrl, float startX, float startY, float startZ);
	void setMesh(ID3DXMesh *mesh);
	void setMtrl(D3DMATERIAL9 mtrl);
	
	ent_type type;
	bool isAlive;
	D3DXMATRIX stupidMatrix;
	virtual void Update();
};

class Character: public Entity
{
private:
	int HP;
	int MP;
public:
	Character(Game *prnt): Entity(prnt){}
	void takeDamage(int amount);
	void useMP(int amount);
	void Update();
};

class Player: public Character
{
public:
	Player(Game *prnt): Character(prnt){}
	void Update();

	void playerDraw();
	// Menu stuff? Items?
};

class Enemy: public Character
{
public:
	Enemy(Game *prnt): Character(prnt){}
	void Update();

	void enemyDraw();
	// AI stuff?
};

class Light: public Entity
{
private:
	D3DLIGHT9 light;
public:
	int lightNum;
	Light(Game *prnt): Entity(prnt){}
	void initLight(float, float, float);		// takes in which light by int

	void Update();
	void lightDraw();
};